home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #10 / Commodore_Disk_User_Vol.4_10_1991_-.d64 / lite demo (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  158 lines

  1. 10 rem ************************
  2. 20 rem * lite menus! o/s demo *
  3. 30 rem * created by           *
  4. 40 rem * madhu surendranath   *
  5. 50 rem * (c) copyright jan 91 *
  6. 60 rem ************************
  7. 70 poke 53280,0:poke53281,0:poke646,15:poke53272,23:printchr$(8)
  8. 80 print"[147][215]elcome to the  [204][201][212][197] [205][197][206][213][211]! [146] demo"
  9. 100 print"[194]y [205]adhu [211]urendranath."
  10. 110 print"[204][201][212][197] [205][197][206][213][211]! will transform your way"
  11. 120 print"of creating menus.  [201]nstead of writing"
  12. 130 print"complex routines in [205]/[195] to get"
  13. 140 print"highlight bars, this routine will do"
  14. 150 print"that job for you, and it is written in"
  15. 160 print"[194][193][211][201][195]!!"
  16. 170 print"[193]ll you have to do is setup a few"
  17. 180 print"parameters and a list of the subject"
  18. 190 print"headings."
  19. 200 gosub 990
  20. 210 print"[147][201]f your still not convicted that it "
  21. 220 print"could be so easy, watch this space "
  22. 230 print"[208][204][197][193][211][197][160][212][217][208][197][160][201][206] 5 [211][213][194][202][197][195][212][211]"
  23. 240 forj=1to5
  24. 250 print" (";j;")";:input o$(j):ifo$(j)=""then250
  25. 260 ln=len(o$(j)):ifln>len(o$(j-1))thendl=j
  26. 265 nextj
  27. 270 print"[208][204][197][193][211][197][160][212][217][208][197] [201][206][160][216] co-ord[160][198][207][210][160][212][200][197][160][204][201][211][212]"
  28. 280 print"x co-ord = ";:input x:ifx<1orx>30 then 280 :dx=x
  29. 290 print"[208][204][197][193][211][197][160][212][217][208][197][160][201][206][160][217] co-ord [198][207][210][160][212][200][197][160][204][201][211][212]"
  30. 300 print"y co-ord = ";:input y:ify<1ory>20 then 300 :dy=y
  31. 310 dx=x: dy=y:gosub 990
  32. 320 print"[147] [212]he list will be printed at:"
  33. 325 print"x=";x;"  y=";y : x1=y
  34. 330 x=0:gosub12000:x=x1
  35. 340 for j=1 to 5
  36. 350 print tab(x);o$(j):
  37. 360 next j
  38. 365 gosub 990
  39. 370 print"[147][206]ow we have to put the bar in for the"
  40. 380 print"highlight.  [206]ow we setup some           variables."
  41. 390 print"[200]ere is a list of parameters :-"
  42. 400 print"[205][201][206] : [205]inimum number of the list"
  43. 410 print"[205][193][216] : [205]aximum number of the list"
  44. 420 print"[208][211]  : [206]umber of lines from top of             screen ([217] co-ord -1)"
  45. 430 print"[193]   : [195]ontrol variable (set to 1)"
  46. 440 print"[212][193]  : [206]umber of chars from left edge of       the screen ([216] co-ord)"
  47. 450 print"and that is it."
  48. 460 print"[211]o in this case, the parameters are :-"
  49. 470 print"[205][201][206]=1:[205][193][216]=5:[208][211]=";(y-1);":[193]=1:[212][193]=";x;":"
  50. 480 print"[199][207][211][213][194]11000"
  51. 490 gosub990
  52. 500 print"[147][201]t is usually nice to surround the "
  53. 510 print"menu with a border."
  54. 520 print"[206]ow with [204][201][212][197]-[205][197][206][213][211]! no more looking"
  55. 530 print"for those graphic characters, just"
  56. 540 print"give x,y co-ords, x,y size length and"
  57. 550 print"a choice of one of the 3 surrounds."
  58. 560 print"[212]he surrounds are defined as :-"
  59. 570 print"[195][200]=1 : '[166]' hatched box"
  60. 580 print"[195][200]=2 : '[176]' square box"
  61. 590 print"[195][200]=3 : '(' circular box"
  62. 600 print"[217]ou can also change the colour if you"
  63. 610 print"wish."
  64. 620 gosub 990
  65. 630 print"[147][197]xample definition of a box."
  66. 640 print"[216]=10:[217]=8:[216]1=15:[217]1=8:[195][207][204]=4:[195][200]=1:         [199][207][211][213][194]10000"
  67. 650 print"[206]ow you will see a box as defined...."
  68. 660 x=10:y=8:x1=15:y1=8:col=4:ch=1:gosub10000
  69. 670 print"[206]ext is a demo of random boxes of"
  70. 680 print"of random colours at random positions."
  71. 690 print"[212]o exit the next screen, press [211][208][193][195][197][146]"
  72. 700 gosub990
  73. 710 print"[147]":poke53272,21:printchr$(8):a=rnd(-ti)
  74. 720 x=int(rnd(1)*29)+1 : y=int(rnd(1)*13)+1
  75. 730 x1=int(rnd(1)*10)+1: y1=int(rnd(1)*10)+1:x1=x1+1:y1=y1+1
  76. 740 col=int(rnd(1)*15)+1 : ch=int(rnd(1)*3)+1
  77. 750 gosub10000
  78. 760 gets$:ifs$=" "then800
  79. 770 goto720
  80. 800 print"[147]":poke53272,23
  81. 810 print"[198]inal [211]ection - [204][201][212][197] [205][197][206][213][211]!"
  82. 820 print"[215]ith the five subject titles you "
  83. 830 print"typed in, [204][201][212][197][160][205][197][206][213][211]! will create a "
  84. 840 print"menu with a hi-light bar using the"
  85. 850 print"the techniques used during this demo."
  86. 860 print"[201] hope that this demo will help you "
  87. 870 print"create menus with the minimum of work."
  88. 880 print"[198]or further assistance, please read"
  89. 890 print"[195]ommodore [196]isk [213]ser."
  90. 900 gosub990:print"[147]":poke53272,21
  91. 905 print"[147]demo menu set up by  you!! [146]"
  92. 907 print"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  93. 908 print"  crsr [146] (execute)   return [146] (select)"
  94. 910 x=dx:y=dy:x1=len(o$(dl))+2:y1=7:col=3:ch=2:gosub10000
  95. 920 print""
  96. 930 x=x+1:y=y+1:gosub12000
  97. 940 forj=1to5:print tab(dx+1);o$(j):nextj
  98. 950 min=1:max=5:ps=y-1:a=1:ta=x:gosub11000
  99. 960 forj=1to1000:nextj:print"";:forj=1to998:print"  [146][157][157] ";:nextj:print"[147]"
  100. 970 poke53272,23:printchr$(8);
  101. 972 print"[147][212]hank you for using this demo."
  102. 974 print"[208]lease feel free to add [204][201][212][197] [205][197][206][213][211]! to"
  103. 976 print"your own programs, but it would be"
  104. 978 print"nice to see an acknowledgement for "
  105. 980 print"using it in your own creations."
  106. 982 print"[204][201][212][197][160][205][197][206][213][211]! menu system created by"
  107. 984 print"[205]adhu [211]urendranath.  [202]anuary 1991."
  108. 989 end
  109. 990 print"      [208]ress < [211][208][193][195][197] > [212]o [195]ontinue [146]"
  110. 992 gets$:ifs$=""then992
  111. 993 ifs$=" "then return
  112. 994 goto 992
  113. 999 end
  114. 10000 rem *****************************
  115. 10010 rem * lite menus! o/s version 1 *
  116. 10020 rem *        created by         *
  117. 10030 rem *  madhu surendranath (16)  *
  118. 10040 rem *  (c) copyright jan. 1991  *
  119. 10050 rem *****************************
  120. 10060 if ch=1 then c$(1)="[166]":c$(2)="[166]":c$(3)="[166]":c$(4)="[166]":c$(5)="[166]":c$(6)="[166]"
  121. 10070 if ch=2 then c$(1)="[176]":c$(2)="[195]":c$(3)="[174]":c$(4)="[194]":c$(5)="[173]":c$(6)="[189]"
  122. 10080 if ch=3 then c$(1)="[213]":c$(2)="[195]":c$(3)="[201]":c$(4)="[194]":c$(5)="[202]":c$(6)="[203]"
  123. 10090 oc=peek(646):poke 646,col
  124. 10100 poke 781,y:poke782,x:sys 65520
  125. 10110 print c$(1);:for a=1 to x1-2
  126. 10120 print c$(2);:next:print c$(3)
  127. 10130 for a=1 to y1-2
  128. 10140 print tab(x) c$(4) tab(x+x1-1) c$(4)
  129. 10150 next a
  130. 10160 print tab(x) c$(5);:for a=1 to x1-2
  131. 10170 print c$(2);:next:print c$(6)
  132. 10180 poke 646,oc
  133. 10190 return
  134. 11000 rem ** flash/menu **
  135. 11010 y=ps+a
  136. 11020 poke 781,y:poke 782,ta:sys65520
  137. 11030 poke 199,1:print o$(a);:poke199,0
  138. 11040 get a$:ifa$<>""anda$<>"[145]"anda$<>chr$(13)then11040
  139. 11050 ifa$=""then b=a:a=a+1:goto11080
  140. 11060 ifa$="[145]"then b=a:a=a-1:goto11100
  141. 11070 ifa$=chr$(13) then zz=y:goto11120
  142. 11080 ifb=max thena=min:poke781,y:poke782,ta:sys65520:printo$(b):b=min:goto11010
  143. 11090 ifb<>max then poke781,ps+b:poke782,ta:sys65520:printo$(b):goto11010
  144. 11100 ifb=min thena=max:poke781,y:poke782,ta:sys65520:printo$(b):b=max:goto11010
  145. 11110 ifb<>min then poke781,ps+b:poke782,ta:sys65520:printo$(b):goto11010
  146. 11120 y=zz:forl=1 to 4
  147. 11130 poke 646,11:gosub11180
  148. 11140 poke 646,12:gosub11180
  149. 11150 poke 646,15:gosub11180
  150. 11160 next l
  151. 11170 return
  152. 11180 print"":forg=1to(zz-1):print"";:nextg:printtab(ta);
  153. 11190 poke199,1:printo$(a):poke199,0:forq=1to10:nextq
  154. 11200 return
  155. 12000 rem * print at *
  156. 12010 poke 781,y:poke782,x:sys65520
  157. 12020 return
  158.